<?php
/**
 * Created by PhpStorm.
 * User: caohejie
 * Date: 2018/8/17
 * Time: 11:11
 */

namespace Workerman\app;

use Workerman\app\Tool;

class dosomeing{

    /**
     * 数据库连接实例
     */
    public $db;

    /**
     * 当前连接实例
     */
    public $connection;

    public function __construct()
    {

    }

    /**
     * 登陆日志
     * @param $data
     */
    public function login($data){


        $pram=array();
        $pram['xm']=$data['xm'];
        $pram['userid']=$data['userid'];
        $pram['brandsid']=$data['brandsid'];
        $pram['channelid']=$data['channelid'];
        $pram['login_time']=$data['login_time'];
        $pram['login_ip']=Tool::ipton($data['login_ip']);
        $pram['from_ip']=Tool::ntoip($this->connection->getRemoteIp());
        $pram['device_type']=$data['device_type'];
        $pram['app_version']=$data['app_version'];

        $insert_id = $this->db->insert('login_'.date("Ymd"))->cols($pram)->query();

    }

    /**
     * 支付日志
     * @param $data
     */

    public function pay($data){

    }


}